package com.gjx.clock.dao

import androidx.room.*
import com.gjx.clock.entity.NormalAlarmClock
import com.gjx.clock.entity.RestAlarmClock

@Dao
interface NormalClockDao {

    @Query("select * from NormalAlarmClock where id = :id")
    fun getClockById(id:Long):NormalAlarmClock

    @Insert
    fun insertClock(clock: NormalAlarmClock): Long

    @Update
    fun updateClock(clock: NormalAlarmClock)

    @Query("select * from NormalAlarmClock")
    fun loadAllClocks(): List<NormalAlarmClock>

    @Delete
    fun deleteClock(clock: NormalAlarmClock)

    @Query("delete from NormalAlarmClock where id = :id")
    fun deleteClockById(id: Long): Int

}